


***Name: "Einfacher Balken"	! Must be defined railing type name
***Code: 10014								! Must be defined identification code
                                            ! It must be also the subroutine label in GDL section

!Notes:

!B Bool       [] both option available [0] only 0 available [1] only 1 available
!I Integer    [0,15] value range 0=<p=<15, [] means unlimited value range [0] means param. not available
!D Double     [0.32,99] value range [] means unlimited value range [0] means param. not available
!M Material   [0] means param. not available
!P Pen        [0] means param. not available
!F Fill       [0] means param. not available
!T Text       [0] means param. not available
!S Font type  [0] means param. not available

***STD***         ! Must be defined standard parameters section delimiter.
                  ! Section may be empty, but parameter names and types not able to change

RailingOffset:     D [-1.0,1.0]=0.05 		! railing offset to edge of stair value: positive value means inside
RailingUpPos:      D [0.0, 10.0]=0.9	 	! railing top position above step level
RailingDnPos:      D [0.0, 10.0]=0.1    	! railing bottom position above step level
ColumnOffset:      D [0,0]=0		    	! column offset to railing line value: positive value means inside
ColumnOffsetUp:    D [0,0]=0       		! column horizontal overhang up
ColumnOffsetDn:    D [0,0]=0       		! column horizontal overhang down
FirstColumnOffset: D [0,0]=0       		! first column offset along the railing
CnPlacementType:   I [0,0]=0         		! no Column, closest to, on every Tread, pieces: 0,1,2,3
ClosestToDistance: D [0,0]=0  			! distance of columns to each other
SnapToCorners:     B [0,0]=0            	! 1=columns  at segment ends

***ADD***         ! Must be defined additional parameters section delimiter (section may be empty)

wr: "Breite" D [0.01, 0.15]=0.07             ! width of rail section
hr: "Hhe" D [0.01, 0.15]=0.05            ! height of rail section
mat_r: "Gelndermat." M []=14           ! railing material


***GDL***         ! Must be defined section delimiter for railing GDL subroutine






!================================================ GDL OF RAILING
!================================================================



10014:                            ! railing code

ac1=r1*2                          ! side of column joker

voct=0.05                         ! vertical oversize of column joker

res=8
resol res


IF current_side=0 then




    !***************************** left side railing


    nr=segm_l[current_segment][2]    !number of railing coordinates
    n=segm_l[current_segment][6]     !number of columns


    fqw1=segm_l[current_segment][3]  !first point index of current segment
    fqwn=segm_l[current_segment][3]+segm_l[current_segment][2]-1  !last point index of current segment


    !********************* rail

    material mat_r

    !plus one point for tube direction at the beginning & in the end

    x1=rail_l [fqw1][1]-(rail_l [fqw1+1][1]-rail_l [fqw1][1])
    y1=rail_l [fqw1][2]-(rail_l [fqw1+1][2]-rail_l [fqw1][2])
    z1=rail_l [fqw1][3]-(rail_l [fqw1+1][3]-rail_l [fqw1][3])

    xn=rail_l [fqwn][1]+(rail_l [fqwn][1]-rail_l [fqwn-1][1])
    yn=rail_l [fqwn][2]+(rail_l [fqwn][2]-rail_l [fqwn-1][2])
    zn=rail_l [fqwn][3]+(rail_l [fqwn][3]-rail_l [fqwn-1][3])


    ff=wr/0.07      ! railing section resizing factors
    fff=hr/0.05

    for i=fqw1 to fqwn
        put rail_l [i][1], rail_l [i][2], rail_l [i][3], 0
    next i


    tube 20, nr+2, 1+2+16+32,
        0.0,             0.025*fff,        1,
        0.006*ff,        0.024786*fff,     1,
        0.011968*ff,     0.024143*fff,     1,
        0.017876*ff,     0.023076*fff,     1,
        0.023693*ff,     0.02159*fff,      1,
        0.028292*ff,     0.018933*fff,     1,
        0.031904*ff,     0.015038*fff,     1,
        0.034209*ff,     0.010252*fff,     1,
        0.035*ff,        0.005*fff,        1,
        0.035*ff,       -0.025*fff,        1,
       -0.035*ff,       -0.025*fff,        1,
       -0.035*ff,        0.005*fff,        1,
       -0.034209*ff,     0.010252*fff,     1,
       -0.031904*ff,     0.015038*fff,     1,
       -0.028292*ff,     0.018933*fff,     1,
       -0.023693*ff,     0.02159*fff,      1,
       -0.017876*ff,     0.023076*fff,     1,
       -0.011968*ff,     0.024143*fff,     1,
       -0.006*ff,        0.024786*fff,     1,
        0.0,             0.025*fff,        1,

        x1, y1, z1, 0,
        get (nsp),
        xn, yn, zn, 0





ELSE





    !***************************** right side railing


    nr=segm_r[current_segment][2]    !number of railing coordinates
    n=segm_r[current_segment][6]     !number of columns


    fqw1=segm_r[current_segment][3]  !first point index of current segment
    fqwn=segm_r[current_segment][3]+segm_r[current_segment][2]-1  !last point index of current segment


    !********************* rail

    material mat_r

    !plus one point for tube direction at the beginning & in the end

    x1=rail_r [fqw1][1]-(rail_r [fqw1+1][1]-rail_r [fqw1][1])
    y1=rail_r [fqw1][2]-(rail_r [fqw1+1][2]-rail_r [fqw1][2])
    z1=rail_r [fqw1][3]-(rail_r [fqw1+1][3]-rail_r [fqw1][3])

    xn=rail_r [fqwn][1]+(rail_r [fqwn][1]-rail_r [fqwn-1][1])
    yn=rail_r [fqwn][2]+(rail_r [fqwn][2]-rail_r [fqwn-1][2])
    zn=rail_r [fqwn][3]+(rail_r [fqwn][3]-rail_r [fqwn-1][3])


    ff=wr/0.07      ! railing section resizing factors
    fff=hr/0.05

    for i=fqw1 to fqwn
        put rail_r [i][1], rail_r [i][2], rail_r [i][3], 0
    next i


    tube 20, nr+2, 1+2+16+32,
        0.0,             0.025*fff,        1,
        0.006*ff,        0.024786*fff,     1,
        0.011968*ff,     0.024143*fff,     1,
        0.017876*ff,     0.023076*fff,     1,
        0.023693*ff,     0.02159*fff,      1,
        0.028292*ff,     0.018933*fff,     1,
        0.031904*ff,     0.015038*fff,     1,
        0.034209*ff,     0.010252*fff,     1,
        0.035*ff,        0.005*fff,        1,
        0.035*ff,       -0.025*fff,        1,
       -0.035*ff,       -0.025*fff,        1,
       -0.035*ff,        0.005*fff,        1,
       -0.034209*ff,     0.010252*fff,     1,
       -0.031904*ff,     0.015038*fff,     1,
       -0.028292*ff,     0.018933*fff,     1,
       -0.023693*ff,     0.02159*fff,      1,
       -0.017876*ff,     0.023076*fff,     1,
       -0.011968*ff,     0.024143*fff,     1,
       -0.006*ff,        0.024786*fff,     1,
        0.0,             0.025*fff,        1,

        x1, y1, z1, 0,
        get (nsp),
        xn, yn, zn, 0



ENDIF


1001444:

del top

RETURN
